%module OgreOverlayManager

%{
#include "OGRE/OgreOverlayManager.h"
	%}

%import "OgrePrerequisites.i"
 //#include "OgreSingleton.h"
 //#include "OgreStringVector.h"
%import "OgreOverlay.i"
 //%import "OgreOverlayElement.i"
 //#include "OgreScriptLoader.h"
 //#include "OgreFrustum.h"

namespace Ogre {

	class OverlayElement;

	class OverlayManager //: public Singleton<OverlayManager>, public ScriptLoader, public OverlayAlloc
    {
    public:
//        typedef map<String, Overlay*>::type OverlayMap;
//		typedef map<String, OverlayElement*>::type ElementMap;
//		typedef map<String, OverlayElementFactory*>::type FactoryMap;

        OverlayManager();
        virtual ~OverlayManager();

//        const StringVector& getScriptPatterns(void) const;

//        void parseScript(DataStreamPtr& stream, const String& groupName);

        Real getLoadingOrder(void) const;

        Overlay* create(const String& name);

        Overlay* getByName(const String& name);

        void destroy(const String& name);

        void destroy(Overlay* overlay);

        void destroyAll(void);

//        typedef MapIterator<OverlayMap> OverlayMapIterator;
//        OverlayMapIterator getOverlayIterator(void);

//        void _queueOverlaysForRendering(Camera* cam, RenderQueue* pQueue, Viewport *vp);

        bool hasViewportChanged(void) const;

        int getViewportHeight(void) const;
        
        int getViewportWidth(void) const;
        Real getViewportAspectRatio(void) const;

        OrientationMode getViewportOrientationMode(void) const;

		OverlayElement* createOverlayElement(const String& typeName, const String& instanceName, bool isTemplate = false);

		OverlayElement* getOverlayElement(const String& name, bool isTemplate = false);

		bool hasOverlayElement(const String& name, bool isTemplate = false);
		
		void destroyOverlayElement(const String& instanceName, bool isTemplate = false);

		void destroyOverlayElement(OverlayElement* pInstance, bool isTemplate = false);

		void destroyAllOverlayElements(bool isTemplate = false);

//		void addOverlayElementFactory(OverlayElementFactory* elemFactory);
		
//		const FactoryMap& getOverlayElementFactoryMap() const;

		OverlayElement* createOverlayElementFromTemplate(const String& templateName, const String& typeName, const String& instanceName, bool isTemplate = false);

		OverlayElement* cloneOverlayElementFromTemplate(const String& templateName, const String& instanceName);

		OverlayElement* createOverlayElementFromFactory(const String& typeName, const String& instanceName);

//		typedef MapIterator<ElementMap> TemplateIterator;

//		TemplateIterator getTemplateIterator ();

		bool isTemplate (String strName) const;

        static OverlayManager& getSingleton(void);

        static OverlayManager* getSingletonPtr(void);
    };
}
